createFromSVG

abstract fun createFromSVG(svg: String): DesignBlock

Create editable graphic blocks from SVG markup, such as the SVG code that Adobe Illustrator copies. Each shape of the SVG becomes a graphic block with a vector path shape, its fill color or gradient, and its stroke. More than one block goes into a group. Embedded images, text, filters, masks and patterns have no shape. Each such part becomes a graphic block with an image fill of only that part. The blocks are not attached to a parent. An SVG user unit is a pixel in a scene measured in pixels. In a scene measured in millimeters or inches it is a point, as Adobe Illustrator writes it.

Return

the group, or the only block.

Parameters

svg

the SVG markup.

Throws

when the SVG cannot be read, draws nothing, has more parts than one import creates, or has a part that cannot be drawn as an image.